package org.huangrui.spark.java.core.rdd.instance;

import org.apache.spark.SparkConf;
import org.apache.spark.api.java.JavaSparkContext;

/**
 * @Author hr
 * @Create 2024-10-16 6:01
 */
public class Spark01_Env {
    public static void main(String[] args) {
        // TODO 创建Spark的运行配置
        SparkConf conf = new SparkConf();
        conf.setMaster("local[*]");
        conf.setAppName("Spark");
        //TODO 创建Spark的运行环境
        // spark.SparkException: A master URL must be set in your configuration
        // spark.SparkException: An application name must be set in your configuration
        JavaSparkContext jsc = new JavaSparkContext(conf);

        //TODO 释放资源
        jsc.close();
    }
}
